<template>
  <div class="box" id="quanxianZongheInfo">
    <div >
      <div class="display_flex box_search">
        <div class="display_flex margin_rignt">
          <p>权利人姓名：</p>
          <div>
            <el-input placeholder="请输入"></el-input>
          </div>
        </div>
        <div class="display_flex margin_rignt">
          <p>复垦片块：</p>
          <div>
            <el-select v-model="value" placeholder="请选择">
              <el-option
                v-for="item in options"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              ></el-option>
            </el-select>
          </div>
        </div>
        <div class="display_flex margin_rignt">
          <p>开始时间：</p>
          <div>
            <el-date-picker v-model="value" type="date" placeholder="选择日期"></el-date-picker>
          </div>
        </div>
        <div class="display_flex margin_rignt">
          <p>截止时间：</p>
          <div>
            <el-date-picker v-model="value" type="date" placeholder="选择日期"></el-date-picker>
          </div>
        </div>
        <el-button type="primary">查询</el-button>
      </div>
      <div class="table">
        <el-table :data="dataArr" border style="width: 100%" v-loading="isListLoading">
          <el-table-column type="index" show-overflow-tooltip label="序号" width="80"></el-table-column>
          <el-table-column prop="applicantName" label="权利人"></el-table-column>
          <el-table-column prop="landName" label="验收地块"></el-table-column>
          <el-table-column prop="place" label="位置"></el-table-column>
          <el-table-column prop="time" label="验收时间"></el-table-column>
          <el-table-column label="操作" fixed="right">
             <template slot-scope="scope">
            <!-- <template> -->
              <el-button size="mini" type="primary" @click="btnById(scope.row)">查看</el-button>
            </template>
          </el-table-column>
        </el-table>
      </div>
      <div class="pages">
        <el-pagination
          @size-change="showSize"
          @current-change="showPage"
          :current-page="needInfo.page"
          :page-sizes="[5, 10, 20, 400]"
          :page-size="needInfo.size"
          layout="total, sizes, prev, pager, next, jumper"
          :total="totalPage"
        ></el-pagination>
      </div>
    </div>
        
  </div>
</template>

<script>
import {
  supervisingInfo,
  supervisingCheck
} from "@/api/quxianzongheYanshou";
import { getLandStatusMapAuditInfo } from "@/api/jjgc";
import tdMap from "@/components/tdMap";
export default {
  components: {
    tdMap
  },
  data() {
    return {
      checked: true,
      flag: 1,
      options: [
        {
          value: "0",
          label: "全部"
        },
        {
          value: "1",
          label: "莲花村片区片块7-1"
        },
        {
          value: "2",
          label: "莲花村片区片块7-2"
        }
      ],
      value: "",
      tableData: [
        {
          date: "",
          name: "",
          address: ""
        },
        {
          date: "",
          name: "",
          address: ""
        }
      ],
      currentPage4: 4,
      title: "",
      titlePath: '',
      seeImgDialog: false,
      imgArr: [],


      dataArr:[],
      needInfo:{
        page:1,
        size:5
      },
      totalPage:0,
      landId:'',
      landData:null, //单条监管详情
      showImgType:null, //分辨视频图片

      isListLoading:false,
      mainDataData:[],
    };
  },
  created(){
    this.getData()
  },
  methods: {
    
    btnById(row){
      console.log(row,"单条数据")
      if(row.yesOrNo=="YES"){
        this.checked=true
      }else{
        this.checked=false
      }
      this.landId=row.landId
      this.$router.push({
        path: "/quxianzongheYanshou/supervisionInformation/detail",
        query: {
          id: row.landId,
          vcr: row.vcr ? row.vcr : "",
          photo: row.photo ? row.photo : "",
          coorDonate: row.coorDonate,
          landName: row.landName,
          time: row.time ? row.time : "",
          place: row.place ? row.place : "",
          checked:this.checked
        }
      });
      
      
    },
    getData(){
      let obj={
        projectId:localStorage.getItem("projectId"),
        page:this.needInfo.page,
        size:this.needInfo.size,
        landId:'',
        applicantName:''
      }
      this.isListLoading=true
      supervisingInfo(obj).then(res=>{
        this.isListLoading=false
        console.log(res,'res')
        this.dataArr=res.data.rows
        this.totalPage=res.data.total
      }).catch(error => {
          this.isListLoading=false
        });
    },
    showSize(val) {
      console.log(`每页 ${val} 条`);
      this.needInfo.size = val;
      this.getData();
    },
    showPage(val) {
      console.log(`当前页: ${val}`);
      this.needInfo.page = val;
      this.getData();
    },
    btnSeeImg(row) {
      this.title = row.name;
      this.titlePath = row.path
      this.showImgType = row.type
      this.seeImgDialog = true;
      var vedio=document.getElementById("showVedio")
      vedio.play()
    },
    handleSizeChange(val) {
      console.log(`每页 ${val} 条`);
    },
    handleCurrentChange(val) {
      console.log(`当前页: ${val}`);
    }
  }
};
</script>

<style scoped>
.box {
  padding: 30px;
}
.display_flex {
  display: flex;
  align-items: center;
}
.box_search .display_flex p {
  font-size: 14px;
  color: #333333;
}
.margin_rignt {
  margin-right: 30px;
}
.table {
  margin: 20px 0px;
}

.landInfo {
  border: 1px solid #efefef;
  box-sizing: border-box;
}
.back {
  margin: 20px;
}
.title_one {
  text-align: center;
  line-height: 40px;
  font-size: 20px;
  color: #444;
  font-weight: bold;
}
.title_little {
  font-size: 13px;
  color: #999;
  margin: 40px 20px 20px 30px;
}
.title .title_little span {
  margin-right: 30px;
}
.project_title {
  background: #f8f8f8;
  height: 50px;
  background: #f8f8f8;
  padding: 0px 30px;
  line-height: 50px;
  color: #48494d;
  font-size: 14px;
  font-weight: bold;
  border-top: 1px solid #efefef;
  border-bottom: 1px solid #efefef;
}
.project_img {
  padding: 30px;
}
.seeImg {
  text-align: center;
}
.project_result {
  padding: 30px;
}
.project_result .display_flex {
  margin-bottom: 20px;
  font-size: 13px;
  color: #444;
  width: 180px;
}
.project_result .display_flex p {
  font-size: 14px;
  color: #444444;
  font-weight: bold;
}
#quanxianZongheInfo >>> .el-checkbox__input.is-disabled+span.el-checkbox__label{
  border-color: #409EFF;
}
#quanxianZongheInfo >>> .el-checkbox__input.is-disabled.is-checked .el-checkbox__inner{
  border-color: #409EFF;
background-color: #409EFF;
}
#quanxianZongheInfo >>> .el-checkbox__input.is-disabled.is-checked .el-checkbox__inner::after{
  border-color: #fff;
}
#quanxianZongheInfo >>> .el-checkbox__input.is-disabled+span.el-checkbox__label{
  color: #12203e;
}
.pages{
  text-align: center;
}
.mapBox_right{
  width: 600px;
  height: 600px;
  margin-top:30px; 
}
</style>